1. Field
This disclosure relates to optimized traffic generation for testing a communications network.
2. Description of the Related Art
In many types of communications networks, each message to be sent is divided into portions of fixed or variable length. These portions may be referred to as packets, frames, cells, datagrams, or data units, all of which are referred to herein as packets. Communications networks that transmit messages as packets are called packet switched networks.
Each packet contains a portion of the original message, commonly called the body of the packet. In addition, each packet contains identification and routing information, commonly called a packet header. The packets are then sent individually over the network through multiple switches or nodes and then reassembled at a final destination using the information contained in the packet headers, before being delivered to a target device or end user. At the receiving end, the reassembled message is passed to the end user in a format compatible with the user's equipment.
Most packet switched networks operate according to a set of established protocols, implemented in a collection of interfaced layers known as a protocol stack. These layers may be defined according to the Open Systems Interconnect (OSI) model, having seven layers (from top to bottom): application, presentation, session, transport, network, data-link and physical.
All but the physical layer of a protocol stack are typically software, though the network and data-link layer may be firmware and/or hardware. Each layer of the protocol stack typically exists to perform a specific function, such as addressing, routing, framing and physical transmission of packets. When a packet is to be transmitted over a network from a source system to a destination system, the packet will pass in a logically downward direction through layers of the protocol stack on the source system, and in a logically upward direction through corresponding layers of the protocol stack on the destination system. Each layer passes the packet to the adjacent layer, either up or down the protocol stack depending on whether the packet has been received or is being transmitted.
Each layer of the protocol stack in the transmitting process may add a respective header to the packet, which provides information to the corresponding layer in a receiving process. Thus, as a packet passes down through the protocol stack on a transmitting system, the packet may gain an additional header at each layer. At the bottom of the stack, the transmitting process may then frame the packet and physically transmit it over the network toward its destination. When the packet reaches its destination, the packet will then pass up through the protocol stack of the destination system. Each layer of the protocol stack in the destination system may obtain useful information from its associated header and will strip its header from the packet before passing the packet up to the next layer for processing.
A variety of standards are known for use in packet switched networks. One of the best known of these, the TCP/IP suite, is typically used to manage reliable transmission of packets throughout the Internet and other IP networks. The TCP/IP standard defines five layers: physical, link, network (IP), transport (TCP) and application. These layers correspond to layers 1, 2, 3, 4 and 7 of the OSI model respectively. Common practice, however, is to describe layers 1, 2, 3, and 4 as the TCP/IP stack, and to view the application layer as lying on top of the stack.
The transport layer of TCP/IP corresponds to layer 4 of the OSI model. The transport layer allows source and destination machines to carry on a reliable conversation with each other.
A second commonly-used transport layer protocol is the UDP (User Datagram Protocol). Unlike TCP, UDP provides no error recovery or reliability mechanisms. Because of this simplicity, UDP packets have shorter headers than TCP packets, and thus consume fewer system resources. Among other applications, UDP may be used to transmit real-time audio or video content.
The IP layer in TCP/IP or UDP/IP corresponds to the network layer of the OSI model. The IP layer provides addressing information to facilitate independent routing of packets within or between networks.
The link layer under TCP/IP or UDP/IP corresponds to the data-link layer of the OSI model. The link layer includes network interface card drivers to connect the machine to the physical network, such as an Ethernet network.
An important application-layer protocol is Real-Time Transport Protocol (RTP) which may be used to deliver data with real-time characteristics. A typical application of RTP is to deliver audio or video content to one or more recipients participating in an interactive session. RTP is normally used with UDP, but may also be used with TCP or other transport-layer protocol. RTP packets do not contain any provisions for error recovery, but do contain both a sequence number and a timestamp. RTP packets are transmitted in sequence, and the embedded information may be used on reception to reconstruct the proper sequence.
RTP is commonly used in conjunction with the RTP Control Protocol (RTCP) which sends and receives periodic control packets interleaved with RTP packets. The function of RTCP is essentially to keep track of the participants in the interactive session.
In general, the machines that implement the RTP/UDP/IP protocol stack are computers. Each of these computers includes one or more processors, memories, and input/output ports, and is managed by an operating system.
The computer memory may include a user space and a kernel space. The kernel space is an area of memory which is strictly reserved for running the kernel, device drivers and any kernel extensions. The UDP/IP protocol stack typically resides in kernel space, and the RTP and RTCP protocols typically reside in user space. Though some portions of the kernel space may be swapped (paged) out to the disk, some portions are typically never swappable. The user space is a memory area used by all applications and this memory can typically be swapped out at any time depending upon the current system requirements. The user space and the kernel space are distinct. An application program usually cannot access the kernel space directly. Application programs may, however, use the kernel to access system resources and hardware through system calls, and are therefore thought of as running above, or on top of, the kernel.
Typically, when an incoming packet enters a computer or other hardware device running a protocol stack, the destination of the packet may be some specific code within the kernel, or it may be an application program. In any event, the packet will typically be processed by multiple layers of the protocol stack and finally arrive at its destination. Similarly, an outgoing packet will typically be processed by multiple layers of the protocol stack before being transmitted onto the network.
When data (e.g., a byte stream) passes between the application layer and the UDP/IP protocol stack's transport layer, the data moves between user space and kernel space. Since user space and kernel space are separate areas of memory, however, the process of moving data includes copying the data to the destination area. This may also include deleting the original, either right away or in a housekeeping operation. Thus, in practice, once an outgoing payload has been processed by the application program in user space, it is copied to kernel space to be processed by the protocol stack. Similarly, once an incoming packet reaches the top of the UDP/IP protocol stack, its payload is copied to user space to be processed by the application.